/* Base styles */
body {
  width: 300px;
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.header h1 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

/* Tools section */
.tools {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-section h2 {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* Buttons */
.tool-btn, .action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tool-btn:hover, .action-btn:hover {
  background: #f5f5f5;
}

.tool-btn.active {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
}

.tool-btn:disabled, .action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Icons */
.icon {
  font-size: 16px;
}

/* Color picker */
.color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

input[type="color"]:hover {
  transform: scale(1.1);
}

/* Toggle switch */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .slider:before {
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status message */
.status-message {
  padding: 8px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.status-message.fade-out {
  opacity: 0;
}

.status-icon {
  font-size: 14px;
}

.status-message.success {
  display: flex;
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.status-message.error {
  display: flex;
  background-color: #fbe9e7;
  color: #c62828;
  border: 1px solid #ffab91;
}

/* Tool status */
.tool-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  color: #666;
}

.tool-status .current-tool {
  font-weight: 600;
  color: #2196f3;
}

/* Tool buttons hover effect */
.tool-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tool-btn.active {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
  transform: translateY(1px);
  box-shadow: none;
}

/* Action buttons hover effect */
.action-btn:hover:not(:disabled) {
  background: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* History buttons */
#undo:disabled, #redo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tool preview */
.tool-btn:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* Undo/Redo buttons */
.undo-redo-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.undo-redo-btns .btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.undo-redo-btns .btn:hover {
  background: #f5f5f5;
}

.undo-redo-btns .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
